#include <goocanvas.h>

typedef enum _LAYOUT_TYPE
{
	LAYOUT_TYPE_UNDIFINE,
	LAYOUT_TYPE_WIN,
	LAYOUT_TYPE_ITEM
}LAYOUT_TYPE;

typedef struct _Layout_Property
{
	//Appoint the xml-file of the layout
	char *xml_path;
	int last_layout_id;
}Layout_Property;

typedef struct _Layout
{
	//struct _Layout * parent;
	GooCanvasItem * parent;
	GooCanvasItem * cavas;

	gboolean inited;
	gboolean visable;
	gboolean active;
	gboolean needreload;

	LAYOUT_TYPE type;
	int id;
	char *name;

	gpointer sms;
	gpointer private;
	gpointer widget;
	Layout_Property layout_property;
	
	gboolean (*init_func)(struct _Layout * layout,gpointer data);
	gboolean (*clear_func)(struct _Layout * layout,gpointer data);
	gboolean (*key_press_func)( struct _Layout * layout,GdkEventKey *event); 

	gboolean (*show_cb_func)(struct _Layout * layout,gpointer data);
	gboolean (*hide_cb_func)(struct _Layout * layout,gpointer data);
}Layout;

Layout *layout_new(GooCanvasItem * ,LAYOUT_TYPE ,int ,const char *,gpointer );
void layout_destroy(Layout * layout);
void layout_show(Layout * layout);
void layout_hide(Layout * layout);
void layout_set_func(Layout *layout,const char *key,gboolean (*func)( Layout * layout,gpointer data));
void layout_set_propertie(Layout *layout, const char *key, gpointer propertie);
void layout_propertie_reset (Layout *layout);
//void layout_set_propertie(Layout *layout, ...);
